﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class PreContractInfoComment : ActiveRecordBase<PreContractInfoComment>
    {
		#region Const Definition
		
		public const string CONST_PreContractInfoCommentID				= "PreContractInfoCommentID";
		public const string CONST_PreContractID							= "PreContractID";
		public const string CONST_Comment								= "Comment";
		public const string CONST_Creator								= "Creator";
		public const string CONST_DateCreated							= "DateCreated";
		public const string CONST_ModifiedBy							= "ModifiedBy";
		public const string CONST_DateModified							= "DateModified";
		public const string CONST_IsRisk								= "IsRisk";
		public const string CONST_CommentPromisedDate					= "CommentPromisedDate";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _preContractInfoCommentID;
        
        // Non Key
        private System.String _comment;
        private Nullables.NullableDateTime _dateCreated;
        private Nullables.NullableDateTime _dateModified;
        private System.Boolean _isRisk;
        private Nullables.NullableDateTime _commentPromisedDate;

        // Parents
        private Employee _creator;
        private Employee _modifiedBy;
        private PreContractInfo _preContractID;
        
        
		

        #endregion

        public PreContractInfoComment() {
               
        }
        public PreContractInfoComment(
            System.String comment
            ,Nullables.NullableDateTime dateCreated
            ,Nullables.NullableDateTime dateModified
            ,System.Boolean isRisk
            ,Nullables.NullableDateTime commentPromisedDate) : this() {
                
            this._comment = comment; 
            this._dateCreated = dateCreated; 
            this._dateModified = dateModified; 
            this._isRisk = isRisk; 
            this._commentPromisedDate = commentPromisedDate; 
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_PRECONTRACTINFOCOMMENT_PRECONTRACTINFOCOMMENTID")]
		#endif
        public System.Int32 PreContractInfoCommentID {
            get { return this._preContractInfoCommentID; }
            set {  this._preContractInfoCommentID = value; }
        }
        
        // Non Key
        [Property]
        public System.String Comment {
            get { return this._comment; }
			set { if (value == null) return; if (value.Length > 2000) this._comment = value.Substring(0,2000); else this._comment = value; }	
        }
        
        [Property]
        public Nullables.NullableDateTime DateCreated {
            get { return this._dateCreated; }
			set { this._dateCreated = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime DateModified {
            get { return this._dateModified; }
			set { this._dateModified = value; }
        }
        
        [Property]
        public System.Boolean IsRisk {
            get { return this._isRisk; }
			set { this._isRisk = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime CommentPromisedDate {
            get { return this._commentPromisedDate; }
			set { this._commentPromisedDate = value; }
        }
        
        
        // Parent Relationships
        [BelongsTo("Creator")]
        public Employee Creator {
            get { return this._creator; }
            set { this._creator = value; }
        }
        
        [BelongsTo("ModifiedBy")]
        public Employee ModifiedBy {
            get { return this._modifiedBy; }
            set { this._modifiedBy = value; }
        }
        
        [BelongsTo("PreContractID")]
        public PreContractInfo PreContractID {
            get { return this._preContractID; }
            set { this._preContractID = value; }
        }
        
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public PreContractInfoComment Clone()
		{
			PreContractInfoComment newPreContractInfoComment = new PreContractInfoComment();
			
            newPreContractInfoComment.Comment = this._comment; 
            newPreContractInfoComment.DateCreated = this._dateCreated; 
            newPreContractInfoComment.DateModified = this._dateModified; 
            newPreContractInfoComment.IsRisk = this._isRisk; 
            newPreContractInfoComment.CommentPromisedDate = this._commentPromisedDate; 
            newPreContractInfoComment.Creator = this._creator ; 
            newPreContractInfoComment.ModifiedBy = this._modifiedBy ; 
            newPreContractInfoComment.PreContractID = this._preContractID ; 
			return newPreContractInfoComment;
		}
    }
}



